<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>新闻首页</title>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta name="description" content=>
		<meta name="keywords" content="">
		<link rel="shortcut icon" href="http://static.bootcss.com/www/assets/ico/favicon.png">
		<!-- 新 Bootstrap 核心 CSS 文件 -->
		<link rel="stylesheet" href="plugin/bootstrap/bootstrap.min.css">
		<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
		<script src="plugin/jquery/jquery.min.js"></script>
		<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
		<script src="plugin/bootstrap/bootstrap.min.js"></script>
	</head>
	<body>
		<h1 class="text-center">欢迎您 {$username}</h1>
		<hr />
		
		<div class="container">
			<button class="pull-right btn btn-success" onclick="location='add.php'">新闻发布</button>
		</div>


		{foreach from=$Datalist item=v}
		<div class="container">
			<h1>
				<a href="detail.php?newsid={$v['newsid']}">{$v['title']}</a>
				
					{if $v['username'] == $username}
				
					&nbsp;&nbsp;&nbsp;&nbsp;<a href="update.php?newsid={$v['newsid']}"><small>修改</small></a>&nbsp;&nbsp;<a href="delete-check.php?newsid={$v['newsid']}" onclick="return confirm('确认删除吗？');"><small>删除</small></a>
					{/if}
			</h1>
			<p>
				{$v['content']|truncate:300:"..."}
			</p>
			<div class="pull-right">发布人：<span class="label label-primary">{$v['username']}</span>
			&nbsp;&nbsp;发布时间：<span class="label label-primary">{$v['publish_date']}</span>
			 &nbsp;&nbsp;浏览次数：<span class="label label-primary">{$v['views']}</span></div>
		</div>
		{/foreach}
	
	</body>
</html>
